<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <form action="/comment/theme" method="post">
        <textarea name="content" id="content" cols="30" rows="10" placeholder="" required></textarea>
        <input type="submit" value="发表">
    </form>

</body>
</html>
<script src="/js/jquery.min.js"></script>
<script>
    $('form').submit(function (event) {
        event.preventDefault();
        var data = $(this).serialize();
        console.log(data);
        $.post('/comment/posting',data,function (resData) {
            console.log(resData);
            alert(resData.message);
            if(resData.message == 0){
                location.href = '/login';
            }
            location.href = '/themeList';
        })
    });


</script>